package top.mataiji.manager.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.mataiji.manager.pojo.BookType;
import top.mataiji.manager.pojo.vo.BookTypeVo;
import top.mataiji.manager.service.BookTypeServe;

import java.util.List;

@RestController
@RequestMapping("bookType")
public class BookTypeController {

    @Autowired
    BookTypeServe bookTypeServe;

    /**
     * 查询所有类型
     * @return
     */
    @RequestMapping("selectAll")
    public List<BookTypeVo> selectAllType(){
        return bookTypeServe.selectAllType();
    }

    @RequestMapping("selectParent")
    public List<BookType> selectParent(){
        return bookTypeServe.selectParent();
    }

    @RequestMapping("selectChildern")
    public List<BookType> selectChildern(Integer parent){
        return bookTypeServe.selectChilderns(parent);
    }
}
